<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<title>
			<%= htmlWebpackPlugin.options.title %>
		</title>
		<script>
			var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS
				.supports('top: constant(a)'))
			document.write(
				'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
				(coverSupport ? ', viewport-fit=cover' : '') + '" />')
		</script>
		<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
	</head>
	<body>
		<script>
			//以下配置信息去自己网站前端获取，查看网站源代码里面有
			const timestamp = '';
			const apiurl = '';
			const apikey = '';
			const appid = '';
			const siteid = '';
		</script>
		<div id="app"></div>
		<script type="text/javascript" src="./static/js/YljSdk.js"></script>
		<script type="text/javascript">
			const config = (window.YljShellApp != undefined && YljAdSdk.osType() == "android") ? {
				cpId: '191247835488325',
				appId: '191278984306821',
				channel: 'demo-xiaomi',
				debug: true,

				intertAdid: '191279360921797',
				splashAdId: '191279118553285',
				fullScreenAdId: '191279417995461',
				rewardAdId: '191279261184197'
			} : {
				cpId: '191247835488325',
				appId: '276849909293189',
				channel: 'iOS',
				debug: true,

				intertAdid: '276850232066245',
				splashAdId: '276850050248901',
				fullScreenAdId: '276850268471493',
				rewardAdId: '276850147532997'
			};
			console.log('广告配置', config)
			//sdk初始化
			function sdkInit() {
				YljAdSdk.init(config.cpId, config.appId, config.channel, config.debug);
			}
			sdkInit()
			//开屏广告
			function splashAd() {
				YljAdSdk.splashAd(config.splashAdId, function(name, data) {
					if ('onLoadSuccess' == name) {
						YljAdSdk.info('sdk_flow', '开屏加载成功!!');
						return;
					}

					if ('onLoadFailed' == name) {
						YljAdSdk.info('sdk_flow', `开屏加载失败!!, 错误码 : ${data&&data.errorCode}, 错误消息 : ${data&&data.errorMsg}`);
						return;
					}

					if ('onShowSuccess' == name) {
						YljAdSdk.info('sdk_flow', '开屏展示成功!!');
						return;
					}

					if ('onShowFailed' == name) {
						YljAdSdk.info('sdk_flow', `开屏展示失败!!, 错误码 : ${data&&data.errorCode}, 错误消息 : ${data&&data.errorMsg}`);
						return;
					}

					if ('onAdClosed' == name) {
						YljAdSdk.info('sdk_flow', '开屏关闭!!');
						return;
					}

					if ('onAdClicked' == name) {
						YljAdSdk.info('sdk_flow', '用户点击广告!!');
						return;
					}

					if ('onTimeOver' == name) {
						YljAdSdk.info('sdk_flow', '倒计时结束!!');
						return;
					}

					if ('onSkip' == name) {
						YljAdSdk.info('sdk_flow', '用户点击跳过!!');
						return;
					}
				}, 5000);
			}
			splashAd()
		</script>
	</body>
</html>